package cz.muni.fi.hauntedhouses.dao;

import cz.muni.fi.hauntedhouses.to.HouseTO;
import java.util.Date;
import java.util.List;

/**
 *
 * @author Andrea Vasekova, 325181
 */
public interface HouseDAO {
    
    /**
     * Creates a House.
     * 
     * @param house the House to create
     * @throws IllegalArgumentException if null given
     */
    public void create(HouseTO house);
    
    /**
     * Finds a House with the given id.
     * 
     * @param id the id of the House to find
     * @return House with the given id
     * @throws IllegalArgumentException if the id argument is null or less than 1
     */
    public HouseTO get(Long id);
    
    /**
     * Updates the given house.
     * If the house doesn't exist it is created properly.
     * 
     * @param house the House to update
     * @throws IllegalArgumentException if null given
     */
    public void update(HouseTO house);
    
    /**
     * Deletes the given House.
     * 
     * @param house the House to delete
     */
    public void delete(HouseTO house);
    
    /**
     * Finds all Houses.
     * 
     * @return all currently existing Houses
     */
    public List<HouseTO> findAll();
    
    /**
     * Finds all Houses with the given name.
     * 
     * @param name the name of the House to find
     * @return a list of all Houses with the given name or null if no such House exists
     */
    public List<HouseTO> findByName(String name);
}
